<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title></title>
  </head>
  <body>
    <div id="app">
      <input type="text" name="" id="" v-focus>
      <br>
      <span v-cat="{action:'add'}"></span>
    </div>
    <script src="./vue.js"></script>
    <script>
      const vm=new Vue({
        el:'#app',
        data:{},
        methods:{},
        directives:{
          cat:{
            inserted(el,binding){
              el.innerText=binding.value.action
            }
          },
          focus:{
            inserted(el){
              el.focus()
            }
          }
        }
       })
    </script>
  </body>
</html>